<?php

require "include/bittorrent.php";
dbconn();
loggedinorreturn();
$HTMLOUT = "";
if ($CURUSER["class"] < UC_MODERATOR && $CURUSER['id'] != $betsadmin)
	stderr("错误", "权限不足");
$HTMLOUT .="<a href='bet.php'><img src='betting.png' alt='Bet' title='博彩' width='400' height='125' /></a>
<h1>竞猜管理</h1>
<table class='main' width='200' cellspacing='0' cellpadding='5' border='0'>
<tr>
<td align='center' class='navigation'><a href='bet_admin.php'>添加竞猜</a></td>
<td align='center' class='navigation'><a href='bet_gamefinish.php'>结束竞猜</a></td>
</tr>
</table>
<br />";
$id = isset($_GET['id']) && is_valid_id($_GET['id']) ? $_GET['id'] : 0;

$a = sql_query("SELECT * FROM betgames WHERE id =" . sqlesc($id) . "") or sqlerr(__FILE__, __LINE__);
$b = mysql_fetch_array($a);

$HTMLOUT .="<form method='post' action='bet_takeedit.php'>
<table cellpadding='5'>
<tr>
<td><input name='id' type='hidden' value='" . htmlspecialchars($id) . "' />
标题 : </td><td><input type='text' name='heading' size='50' value='" . htmlspecialchars($b['1']) . "' />
</td>
</tr>
<tr>
<td><i>条件 :</i></td><td><input type='text' name='undertext' size='50' value='" . htmlspecialchars($b['2']) . "' /></td>
</tr>
<tr>
<td align='center'colspan='2'>结束时间
<input type='text' name='endtime' onfocus='WdatePicker({dateFmt: \"yyyy-MM-dd HH:mm:ss\", isShowWeek: \"true\", minDate: \"%y-%M-%d %H:%m:%s\"})' class='Wdate' style='width:160px'/>
</td>
 </tr><tr>
<td>排序:</td> <td><input type='radio' name='sort' value='1' checked='checked' />
押注时间<input type='radio' name='sort' value='0' />
押注金额</td></tr>
</table><br />
<input type='submit' value='保存' />
</form>
<br /><br />
<a href='bet_delgame.php?id=" . $b['0'] . "'><u>点击</u></a> 删除这个盘面
<br /><br />
<a href='bet_nullbet.php?id=" . $b['0'] . "'><u>点击</u></a> 删除这个盘面并返还魔力值";
stdhead('博彩');
print $HTMLOUT;
stdfoot();
